import React from 'react';
import PropTypes from 'prop-types';
import css from './index.less';
import QRCode from 'qrcode.react';

import qrcode from 'assets/images/qrcode.png';

export default class Header extends React.Component {
  static propsTypes = {};
  static defaultProps = {
    data: {
      goodsTaobaoId: 557489349781,
      title: '爱华仕铝框行李箱20寸女旅行登机箱飞机轮拉杆箱24寸海关锁硬箱',
      price: '149',
      picUrl: 'http://gd2.alicdn.com/bao/uploaded/i2/287745076/TB2mPWSdUsIL1JjSZPiXXXKmpXa_!!287745076.jpg',
      itemUrl: '',
    }
  };

  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {
  }

  render() {
    const {title, price, picUrl, itemUrl} = this.props.data;
    return (
      <section className={css.wrapper}>
        <img src={picUrl}/>
        <p>{title}</p>
        <footer>
          {/*<span>￥{price}</span>*/}
          <div className={css.code}>
            <img src={qrcode}/>
            <QRCode value={itemUrl}/>
          </div>
        </footer>
      </section>
    );
  }
}
